/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication30;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.util.*;
import java.io.*;


/**
 *
 * @author marian.acsinia
 */
public class NotepadClass {
    public static void main (String[]args) throws AWTException{
       //il metodo getRuntime della classe runtime permette
        //di lanciare comandi come da console cmd
        Runtime rs = Runtime.getRuntime();
        try { //tentaivo
            rs.exec("notepad");
           
        }
        catch (IOException e) { //cattura eccezioni del tentativo
            System.out.println(e);
            
        }
        Robot robot = new Robot();
        robot.keyPress (KeyEvent.VK_B);
        robot.keyPress (KeyEvent.VK_E);
        robot.keyPress (KeyEvent.VK_N);
        robot.keyPress (KeyEvent.VK_V);
        robot.keyPress (KeyEvent.VK_E);
        robot.keyPress (KeyEvent.VK_N);
        robot.keyPress (KeyEvent.VK_U);
        
    }
    
}
